- @no_container = true
- page_title "语言", "图表"
= render 'head'

%div{ class: container_class }
  .sub-header-block
    .oneline
      此版本库使用的编程语言

  .row
    .col-md-8
      %canvas#languages-chart{ height: 400 }
    .col-md-4
      %ul.bordered-list
        - @languages.each do |language|
          %li
            %span{ style: "color: #{language[:color]}" }
              = icon('circle')
            &nbsp;
            = language[:label]
            .pull-right
              = language[:value]
              \%

:javascript
  var data = #{@languages.to_json};
  var ctx = $("#languages-chart").get(0).getContext("2d");
  var options = {
    scaleOverlay: true,
    responsive: true,
    maintainAspectRatio: false
  }
  var myPieChart = new Chart(ctx).Pie(data, options);
